import React from 'react';

const Dialog = ({ message }: { message: Message; }) => {
    const isMe = message.role === 'user';
    return (<div className={`chat ${isMe ? 'chat-end' : 'chat-start'}`}>
        <div className="chat-image avatar">
            <div className="w-10 rounded-full">
                <img src={`/${isMe ? 'me' : 'gpt'}.png`} />
            </div>
        </div>
        <div className={`chat-bubble ${isMe ? 'chat-bubble-info' : 'chat-bubble-accent'}`}>
            {message.content}
        </div>
    </div>);
};

export default Dialog;